package br.project.cdd.vo;

import java.sql.SQLException;
import java.util.ArrayList;
import br.project.cdd.bean.CddBean;
import br.project.cdd.dao.CddDAO;

public class CddVo {
	
	public void inserirCdd(String nome, String localidade, String uf) 
	{
		try
		{
			CddDAO cddDao = new CddDAO();
			cddDao.inserirCdd(nome, localidade, uf);
		}
		catch(ClassNotFoundException clEx)
		{
			clEx.printStackTrace();
		}
		catch(SQLException sqlEx)
		{
			sqlEx.printStackTrace();
		}
	}
	
	public ArrayList<CddBean> selecionarTodosCdds()
	{
		ArrayList<CddBean> listRetorno = null;
		
		try
		{
			CddDAO cddDao = new CddDAO();
			listRetorno = cddDao.selecionarTodosCdds();
		}
		catch(ClassNotFoundException clEx)
		{
			clEx.printStackTrace();
		}
		catch(SQLException sqlEx)
		{
			sqlEx.printStackTrace();
		}
		
		return listRetorno;
	}
}
